﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="UserHours.aspx.cs" Inherits="WebClient.UserHours" %>
<%@ MasterType VirtualPath="~/Site.master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>

    <h2>
        Team Management
    </h2>
    
    <asp:UpdatePanel ID="UpdateContent" UpdateMode="Conditional" runat="server">
    <ContentTemplate>
    <div id="teamSelection">
    <p>Please Select a Team: <asp:ComboBox ID="TeamSelect" runat="server" 
            AutoPostBack="true" DropDownStyle="DropDownList" CssClass="" 
            OnTextChanged="LoadNewData" onload="TeamSelect_Load" />
    </p>
    </div>
        <asp:Panel ID="EditOpenHours" runat="server">
            <p>
                <span class="failureNotification">
                    <asp:Literal ID="ErrorMessage" runat="server"></asp:Literal>
                </span>
                <asp:ValidationSummary ID="TotalHoursValidationGroupSummary" runat="server" CssClass="failureNotification" 
                         ValidationGroup="TotalHoursValidationGroup"/>
            </p>
    
            <asp:Label ID="TotalHoursLabel" runat="server" AssociatedControlID="TotalHours">Total Hours: </asp:Label>
            <asp:TextBox ID="TotalHours" runat="server" Width="150" Text="0" ></asp:TextBox>
            <asp:RangeValidator ID="DoubleInputValidator" runat="server" CssClass="failureNotification" ValidationGroup="TotalHoursValidationGroup"  ErrorMessage="Must enter a value between 1 and 40." ToolTip="Must enter a value between 1 and 40." ControlToValidate="TotalHours" Type="Double" MinimumValue="1" MaximumValue="40" >*</asp:RangeValidator>
            <asp:Button ID="SaveHours" runat="server" OnClick="SubmitHours" Enabled="true" Text="Submit Hours" />
            
        </asp:Panel>

        <hr />
        <h3>Hours Submitted: <asp:Label ID="UserName" runat="server" /></h3>
        <asp:GridView ID="CurrentHours" runat="server" HorizontalAlign="Center" 
            AutoGenerateColumns="False">
        <Columns>
            <asp:BoundField DataField="TotalHours" HeaderText="Hours Worked" />
            <asp:BoundField DataField="Date" HeaderText="Work Date" />
            <asp:BoundField DataField="PayStart" HeaderText="Pay Period Start Date" />
            <asp:BoundField DataField="PayEnd" HeaderText="Pay Period End Date" />
        </Columns>
    </asp:GridView>

    <asp:Button ID="SendButton" runat="server" Text="Send TimeSheet"  
        OnClick="SendTimeSheet"/>

        <div id ="errorPanel">
                    <asp:Panel ID="ErrorPanel" runat="server" Visible="False">
                    <asp:TextBox ID="ErrorText" runat="server" Height="155px" Width="328px" 
                            ForeColor="White" TextMode="MultiLine" BackColor="Black"></asp:TextBox>
                        <br />
                    <asp:Button ID="ErrorClose" runat="server" Text="Close" onclick="ErrorClose_Click"></asp:Button>
                    </asp:Panel>
                </div>

    </ContentTemplate>
    </asp:UpdatePanel>

    
</asp:Content>
